package tbs.framework.async.task;

import org.jetbrains.annotations.NotNull;
import tbs.framework.async.container.IAsyncTaskService;

public interface IAsyncTask {

    /**
     * 任务id
     *
     * @return
     */
    @NotNull String taskId();

    /**
     * 执行
     *
     * @param container
     * @throws Throwable
     */
    void execute(@NotNull IAsyncTaskService container) throws Throwable;

    /**
     * 是否正在执行
     *
     * @return
     */
    boolean isRunning();
}
